<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>首页</title>

<link href="lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css"/>
<link href="lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css"/>

</head>
<body>
	<!-- <h1>世界 你好</h1> -->
	<div id="layout1">
            <div  position="left"></div>
            <div position="center" title="标题">
            <div id="toolbar"></div>
			<div id="maingrid"></div>
            </div>
            <!-- <div position="right"></div>
            <div position="top"></div>
            <div position="bottom"></div> -->
    </div> 
        
	
	
	<script type="text/javascript" src="lib/jquery/jquery-1.9.0.min.js"></script>
	<script src="lib/ligerUI/js/ligerui.all.js"></script>
	<script>
		//console.log($);
		
		$("#layout1").ligerLayout({ 
			leftWidth:200
		}); 
		
		$("#toolbar").ligerToolBar({ items: [
                 { text: '增加', click: itemclick, icon:'add'},
                 { line:true },
                 { text: '修改', click: itemclick, icon:'edit' },
                 { line:true },
                 { text: '删除', click: itemclick, icon:'delete'}
             ]
        });
		
		function itemclick(item) {
			$.ligerDialog.open({
				title: item.text,
				width: 500,
				height: 500,
				url: '/form',
				buttons: [
				            { text: '确定', 
				            	onclick: function (item, dialog) { dialog.frame.test(); },
				            	cls:'l-dialog-btn-highlight' },
				            { text: '取消', 
				              onclick: function (item, dialog) { dialog.close(); } }
				         ],
				modal: true, 
				isResize: true
			});
			
		}
		
		$( "#maingrid" ).ligerGrid({
			columns: [
			          {display:'ID', name:'ID',width:'60',align:'center',hide:true},
			          
			          {display:'车牌号', name:'CARNUM',width:'120',align:'center'},
			          {display:'驾驶员', name:'DRIVERNAME',width:'120',align:'center'},
			          {display:'手机号', name:'MOBNUM',width:'120',align:'center'},
			          {display:'登记时间', name:'CHECKINTIME',width:'180',align:'center'},
			          {display:'状态', name:'STATE',width:'100',align:'center', render:function(item) {
			        	  var res = ["登记","叫号","正常作业","作业完成"];
			        	  return res[item.STATE-1];
			          }}
			 ], 
			 width:'100%', 
			 height:'90%', 
			 url:'/json', 
			 rownumbers:true,
			 enabledSort:true
		});
	</script>
</body>
</html>